<?php 
use Yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\widgets\LinkPager;
use yii\helpers\Url;
echo $this->render('_centernav');
?>
<table>
	<?php foreach($teacher as $k=>$v){?>
	<tr>
		<td><img src="http://files.bwphp.com/<?php echo $v['teacher_thumb']?>" alt="" width='100px' height='50px'><a href="javascript:void(0)" teacher_id="<?php echo $v['teacher_id']?>" class='delteacher'>×</a></td>
		<td></td>
	</tr>
	<tr>
		<td>教师姓名</td>
		<td><?php echo $v['teacher_name']?></td>
	</tr>
	<tr>
		<td>教师来源</td>
		<td><?php echo $v['from_name']?></td>
	</tr>
	<tr>
		<td>教师职位</td>
		<td><?php echo $v['position_name']?></td>
	</tr>
	<tr>
		<td>教师描述</td>
		<td><?php echo $v['teacher_desc']?></td>
	</tr>
	<tr>
		<td>擅长领域</td>
		<td><?php echo $v['teacher_at']?></td>
	</tr>
	<?php }?>
</table>

			<?php echo LinkPager::widget([
				'pagination' => $pagination,
				'prevPageLabel'=>'上一页',
				'nextPageLabel'=>'下一页',
			]);?>
<script>
	$(".delteacher").click(function(){
		if(confirm("确定要取消对此教师的喜欢吗？"))
	    {
			var teacher_id = $(this).attr('teacher_id')
			$.ajax({
			   type: "POST",
			   url: "<?= Url::to(['center/delteacher'])?>",
			   data: "teacher_id="+teacher_id,
			   success: function(msg){
				 if(msg == 1){
					alert('取消成功')
					location.reload();
				 }
			   }
			});
	    }else{
			return false;
	    }
	})
</script>